package org.jeecg.modules.supplier.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.supplier.Vo.SupplierMatchVo;
import org.jeecg.modules.supplier.entity.Supplier;
import org.jeecg.modules.supplier.entity.qualification;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface ISupplierService extends IService<Supplier> {

    /**
     * 批量导入多表数据
     * @param file 导入文件
     * @param importType 导入类型标识，用于区分不同的导入场景
     * @return 导入结果
     */
    Result<?> batchImportMultiTableData(MultipartFile file, String importType);

    boolean saveSupplier(Supplier supplier);

    boolean updateSupplier(Supplier supplier);

    boolean auditSupplier(String id, String auditStatus, String auditOpinion, String auditor);

    IPage<Supplier> querySupplierPage(Page<Supplier> page, Supplier supplier);

    Result<?> importSupplier(MultipartFile file);

    List<Supplier> getSuppliersForLottery(String category);

//    boolean updateWinningRate(String supplierId, int winningCount, int totalCount);

    boolean checkCreditCodeExists(String creditCode, String id);

    List<qualification> getQualificationList(String supplierId);

    Supplier getByCreditCode(String creditCode);

    void saveSupplierQualifications(List<qualification> qualifications, String supplierId);

    List<String> getSupplierIdByName(String supplierName);

    String getCreditCodeBySupplierId(String creditCode);


    List<SupplierMatchVo> getSupplierMatch(String category);
}
